<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h3 class="title">Caixa Requerimento</h3>
            <style>
                .ui-tabs .ui-tabs-nav.ui-widget-header li.ui-state-active a, 
                .ui-tabs .ui-tabs-nav.ui-widget-header li.ui-state-active a {
                    background-color: #69B8EA !important;
                    background-image: -moz-linear-gradient(center top , #69B8EA, #69B8EA) !important;
                    color: #FFFFFF !important;
                    width: 89%;
                }
            </style> 
            <h:form id="realtyForm" enctype="multipart/form-data">
                <p:growl id="messages" showDetail="false" autoUpdate="true"  />
                <hr/>
                <p:tabView id="tabView"  orientation="left">
                    <p:tab id="tabdiario" title="Diário">

                        <h5 class="title">Dados Gerais</h5>
                        <fieldset>
                            <legend>Caixa Diário</legend>

                            <p:panel header="Averbação" style="width: 30%; float: left;"
                                     styleClass="container_24 clearfix both ">
                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdRequerimentoAverbacao()}" 
                                               style="float: right"/>
                                <div class="clear" />

                                <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                                <h:outputText value="#{managerPesquisarCaixaRequerimento.valorRequerimentoAverbacao()}"
                                              style="float: right">
                                    <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                                </h:outputText>    
                                <div class="clear" />
                                <p:commandButton  icon="ui-icon-circle-plus" update="@form" oncomplete="dlg.show()" style="float: right"/>
                            </p:panel>
                            <br/>

                            <p:panel header="Forus" style="width: 30%; float: left; margin-top: -22px; margin-left: 5px;"
                                     styleClass="container_24 clearfix both" >

                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdRequerimentoITBI()}" 
                                               style="float: right"/>
                                <div class="clear" />

                                <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                                <h:outputText value="#{managerPesquisarCaixaRequerimento.valorRequerimentoITBI()}"
                                              style="float: right">
                                    <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                                </h:outputText> 
                            </p:panel>
                            <br/>

                            <p:panel header="Revisão de Alinhamento" style="width: 30%; float: left; margin-top: -44px; margin-left: 5px;"
                                     styleClass="container_24 clearfix both">

                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdRequerimentoRevisaoAlinhamento()}" 
                                               style="float: right"/>
                                <div class="clear" />

                                <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                                <h:outputText value="#{managerPesquisarCaixaRequerimento.valorRequerimentoRevisaoAlinhamento()}"
                                              style="float: right">
                                    <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                                </h:outputText> 
                            </p:panel>

                        </fieldset>
                        <fieldset>
                            <legend>Caixa Mensal</legend> 

                            <p:lineChart title="Caixa Mês"
                                         legendPosition="ne" animate="true"  
                                         value="#{managerPesquisarCaixaRequerimento.linearCaixaMes}" 
                                         xaxisLabel="Meses" yaxisLabel="Quantidade"/>
                        </fieldset> 
                    </p:tab> 

                    <p:tab id="tabdata" title="Data">
                        <p:panel id="panelData" header="Pesquisa por Data" 
                                 styleClass="container_24 clearfix both">
                            <fieldset>
                                <legend>Pesquisar Caixa</legend> 

                                <p:outputLabel value="Data Início: " styleClass="grid_3"/>
                                <p:calendar id="dataInputIni" styleClass="grid_8" 
                                            value="#{managerPesquisarCaixaRequerimento.dataIni}"
                                            showOn="both" locale="pt" yearRange="1900:2020" 
                                            navigator="true" pattern="dd/MM/yyyy"/>

                                <p:outputLabel value="Data Fim: " styleClass="grid_3"/>
                                <p:calendar id="dataInputFim" styleClass="grid_8" 
                                            value="#{managerPesquisarCaixaRequerimento.dataFim}"
                                            showOn="both" locale="pt" yearRange="1900:2020" 
                                            navigator="true" pattern="dd/MM/yyyy"/>

                            </fieldset>
                            <div class="buttonAction">
                                <p:commandButton  id="pesquisarCommandButton" value="Pesquisar" icon="ui-icon-search"
                                                  update=":realtyForm:tabView:panelData, :realtyForm:tabView:panelResultado" process="@this, :realtyForm:tabView:panelData, :realtyForm:tabView:panelResultado"
                                                  actionListener="#{managerPesquisarCaixaRequerimento.pesquisarData()}"
                                                  styleClass="ui-priority-primary" />
                            </div>
                        </p:panel>

                        <p:panel id="panelResultado" header="Resultado" style="#{managerPesquisarCaixaRequerimento.ativaPanel ? '':'display:none'}"
                                 styleClass="container_24 clearfix both ">

                            <p:panel header="Averbação" style="width: 30%; float: left;"
                                     styleClass="container_24 clearfix both">

                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdAverbacao}" 
                                               style="float: right"/>

                                <div class="clear" /> 
                                <p:outputLabel value="Valor Total" styleClass="grid_12"/>
                                <p:outputLabel value="R$ #{managerPesquisarCaixaRequerimento.valorAverbacao}"
                                               style="float: right"/>
                                <div class="clear"/>
                                <p:commandButton  icon="ui-icon-circle-plus" update=":realtyForm:modalDialogParamData" process=":realtyForm:modalDialogParamData" oncomplete="dlgParamData.show()" style="float: right"/>
                            </p:panel>
                            <br/>

                            <p:panel header="Forus" style="width: 30%; float: left; margin-top: -22px; margin-left: 5px;"
                                     styleClass="container_24 clearfix both">

                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdITBI}" 
                                               style="float: right"/>
                                <div class="clear" />

                                <p:outputLabel value="Valor Total" styleClass="grid_12"/>
                                <h:outputText value="#{managerPesquisarCaixaRequerimento.valorITBI}"
                                              style="float: right">
                                    <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                                </h:outputText> 
                            </p:panel>
                            <br/>

                            <p:panel header="Revisão de Alinhamento" style="width: 30%; float: left; margin-top: -44px; margin-left: 5px;"
                                     styleClass="container_24 clearfix both">

                                <p:outputLabel value="Quantidade" styleClass="grid_12" />
                                <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdRevisaoAlinhamento}" 
                                               style="float: right"/>
                                <div class="clear" />

                                <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                                <h:outputText value="#{managerPesquisarCaixaRequerimento.valorRevisaoAlinhamento}"
                                              style="float: right">
                                    <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                                </h:outputText> 

                            </p:panel>
                        </p:panel>
                    </p:tab>
                </p:tabView>

                <p:dialog id="modalDialog" header="Tipos de Averbação" widgetVar="dlg" modal="true" 
                          height="200" width="700" closable="true" resizable="false" closeOnEscape="true">

                    <p:panel header="Transferência" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both ">

                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdTipoAverbacaoTransferencia()}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoTransferencia()}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>

                    <p:panel header="Mudança Nome" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both ">

                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdTipoAverbacaoMudancaNome()}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoMudancaNome()}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>

                    <p:panel header="Desmembramento" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both">

                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdTipoAverbacaoDesmembramento()}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoDesmembramento()}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>
                </p:dialog> 

                <!--DIALOG POR DATAINI E POR DATAFIM-->

                <p:dialog id="modalDialogParamData" header="Tipos de Averbação" widgetVar="dlgParamData" modal="true" 
                          height="200" width="700" closable="true" resizable="false" closeOnEscape="true">

                    <p:panel header="Transferência" id="panelTrans" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both">

                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdAverbacaoTransferencia}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoTransferencia}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>

                    <p:panel header="Mudança Nome" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both">
                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdAverbacaoMudancaNome}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoMudancaNome}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>

                    <p:panel header="Desmembramento" style="width: 30%; float: left;"
                             styleClass="container_24 clearfix both">

                        <p:outputLabel value="Quantidade" styleClass="grid_12" />
                        <p:outputLabel value="#{managerPesquisarCaixaRequerimento.qtdAverbacaoDesmembramento}" 
                                       style="float: right"/>
                        <div class="clear" />

                        <p:outputLabel value="Valor Total"  styleClass="grid_12"/>
                        <h:outputText value="#{managerPesquisarCaixaRequerimento.valorAverbacaoDesmembramento}"
                                      style="float: right">
                            <f:convertNumber pattern="R$ #,###,##0.00" locale="pt,BR"/>
                        </h:outputText>    
                        <div class="clear" />
                    </p:panel>
                </p:dialog>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
